package com.glsc.ngateway.common.base.repo.mysql.gateway.platform;


import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.TRPARequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface TRPARequestRepository extends JpaRepository<TRPARequest, Long> {

    Page<TRPARequest> findAllByOrderByStatusAscCreateTimeDesc(Pageable pageable);

    List<TRPARequest> findByStatus(String status);

    List<TRPARequest> findByRequestId(String requestId);

    @Query(value = "select m from TRPARequest m where m.requestId in (:requestIdList)  ")
    List<TRPARequest> findByRequestIdList(List<String> requestIdList);
}
